package gao.xiaolei.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class UrlRoleId implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -8201387042101654702L;

	@Column(columnDefinition = "char(32)")
	private String url_id;

	@Column(columnDefinition = "char(32)")
	private String role_id;

	public UrlRoleId(String url_id, String role_id) {
		super();
		this.url_id = url_id;
		this.role_id = role_id;
	}

	public UrlRoleId() {
		super();
	}

	public String getUrl_id() {
		return url_id;
	}

	public void setUrl_id(String url_id) {
		this.url_id = url_id;
	}

	public String getRole_id() {
		return role_id;
	}

	public void setRole_id(String role_id) {
		this.role_id = role_id;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((role_id == null) ? 0 : role_id.hashCode());
		result = prime * result + ((url_id == null) ? 0 : url_id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		UrlRoleId other = (UrlRoleId) obj;
		if (role_id == null) {
			if (other.role_id != null)
				return false;
		} else if (!role_id.equals(other.role_id))
			return false;
		if (url_id == null) {
			if (other.url_id != null)
				return false;
		} else if (!url_id.equals(other.url_id))
			return false;
		return true;
	}

}
